package com.imut.common;

import java.sql.Connection;
import java.sql.DriverManager;

public class ConnectionFactory {

	private static String driver="com.mysql.jdbc.Driver";
	private static String url="jdbc:mysql://localhost:3306/xe?useUnicode=true&characterEncoding=UTF-8";

	private static String userName="root";
	private static String password="root";

	synchronized public static Connection getConnection(){
		try{
			Class.forName(driver);
			return DriverManager.getConnection(url,userName,password);

		}catch(Exception e){

			e.printStackTrace();
			return null;
		}
	}
}

